% TEST_ID: LANG-CONTROL-FLOW-0012
% CATEGORY: language/control-flow
% while 语句

function test_while
    n = 10;
    f = n;
    while n > 1
        n = n - 1;
        f = f * n;
    end
    assert(n == 1);
    assert(f == 3628800);

    limit = 0.8;
    s = 0;
    tmp = 0;

    while 1
        tmp = tmp + 0.1;
        if tmp > limit
            break
        else
            continue
        end
        s = s + tmp;
    end
    assert(s == 0);

end

